package com.atlyc.common.dto;

import java.util.ArrayList;

/**
 * 该类用来封装api返回数据
 * 
 * @author lyc
 * @date 2016年5月11日 下午2:55:22
 * 
 */
public class ReturnResult {
	/**
	 * 返回码，1000表示成功
	 */
	private int code;
	/**
	 * 返回消息，可以是错误信息，也可以是其他提示信息
	 */
	private String msg;
	/**
	 * 实际的数据返回
	 */
	private Object data = new ArrayList<Object>();

	public ReturnResult() {
		this.code = 0;
		this.msg = "OK";
	}

	public ReturnResult(int code, String message) {
		this.code = code;
		this.msg = message;
	}

	public ReturnResult(int code, String message, Object data) {
		super();
		this.code = code;
		this.msg = message;
		this.data = data;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	
	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	@Override
	public String toString() {
		return "ReturnResult [code=" + code + ", message=" + msg + "]";
	}

	/**
	 * @return the msg
	 */
	public String getMsg() {
		return msg;
	}

	/**
	 * @param msg the msg to set
	 */
	public void setMsg(String msg) {
		this.msg = msg;
	}

}
